{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "01bd675a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "469593"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.datetime.today().microsecond"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "d18ae850",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "270969\n",
      "This minute seems a little odd.\n",
      "271823\n"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "# 本项目用到了时间模块\n",
    "print(datetime.datetime.today().microsecond)\n",
    "\n",
    "odds = [  1, 3,  5,  7,  9, 11,13,15,17,19,\n",
    "             21,23,25,27,29,31,33,35,37,39,\n",
    "             41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "right_this_minute = datetime.datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(right_this)\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")\n",
    "\n",
    "print(datetime.datetime.today().microsecond)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "81534a5b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "c7ab52bc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime().tm_wday"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "c23b35f8",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid character '：' (U+FF1A) (1181666634.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  Input \u001b[0;32mIn [25]\u001b[0;36m\u001b[0m\n\u001b[0;31m    if今天==1：\u001b[0m\n\u001b[0m           ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid character '：' (U+FF1A)\n"
     ]
    }
   ],
   "source": [
    "#tm_wday:  0-6  0是星期一\n",
    "今天=time.localtime().tm_wday\n",
    "\n",
    "if今天==1：\n",
    "   print（“今天有python课，哈哈哈哈，时间为：下午2:30—4:50”）\n",
    "else\n",
    "   print（“今天没有python课”）\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1e70e25f",
   "metadata": {},
   "source": [
    "## 2.1模块--标准库\n",
    "·标准库是python开发团队为满足python用户日常需求而写好的一些模块，可以直接使用：import模块名称\n",
    " 1.sys\n",
    " 2.os模块\n",
    " 3.datetime模块\n",
    "2.2模块--开源模块（pypi.org)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "270a7e30",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'sys' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[0;32mIn [26]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43msys\u001b[49m\u001b[38;5;241m.\u001b[39mversion\n",
      "\u001b[0;31mNameError\u001b[0m: name 'sys' is not defined"
     ]
    }
   ],
   "source": [
    "sys.version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "bddd5f5a",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'os' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[0;32mIn [3]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m (\u001b[43mos\u001b[49m\u001b[38;5;241m.\u001b[39mgetcwd)\n",
      "\u001b[0;31mNameError\u001b[0m: name 'os' is not defined"
     ]
    }
   ],
   "source": [
    "(os.getcwd)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "cff0d9c7",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'datetime' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[0;32mIn [6]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mdatetime\u001b[49m\u001b[38;5;241m.\u001b[39mdate\u001b[38;5;241m.\u001b[39mtoday()\n",
      "\u001b[0;31mNameError\u001b[0m: name 'datetime' is not defined"
     ]
    }
   ],
   "source": [
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9512aff1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "31fa7c42",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2022, 8, 30)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "73add106",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5df9a2af",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=30, tm_hour=14, tm_min=29, tm_sec=33, tm_wday=1, tm_yday=242, tm_isdst=0)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "deb7b767",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1661841040.994315"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()#时间戳"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "66b76b4f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "50.5887727434696"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()/60/60/25/365"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "8b19f733",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1970"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2022-52"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "baaf7486",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=30, tm_hour=6, tm_min=33, tm_sec=52, tm_wday=1, tm_yday=242, tm_isdst=0)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.gmtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "1417a22f",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'apple'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Input \u001b[0;32mIn [17]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mapple\u001b[39;00m\n",
      "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'apple'"
     ]
    }
   ],
   "source": [
    "import apple"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "41302f91",
   "metadata": {},
   "source": [
    "## 3.赋值\n",
    "## 4."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
